package com.eastidea.live.entity;

// Generated Feb 8, 2013 11:13:15 AM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.SEQUENCE;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * AppUser generated by hbm2java
 */
@Entity
@Table(name = "app_user", schema = "public")
public class AppUser implements java.io.Serializable {

	private Long id;
	private AppCompany appCompany;
	private String email;
	private String passwd;
	private String token;
	
	private String phone;
	private String im;
	private Date updateTime;
	private int status;

	public AppUser() {
	}

	public AppUser(String account, String passwd, String nickName,
			Date updateTime, int status) {
		this.passwd = passwd;
		this.updateTime = updateTime;
		this.status = status;
	}

	public AppUser(AppCompany appCompany, String account, String passwd,
			String nickName, String email, String phone, String im,
			Date updateTime, int status) {
		this.appCompany = appCompany;
		this.passwd = passwd;
		this.email = email;
		this.phone = phone;
		this.im = im;
		this.updateTime = updateTime;
		this.status = status;
	}

	@SequenceGenerator(name = "generator", sequenceName = "app_user_seq")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "company_id")
	public AppCompany getAppCompany() {
		return this.appCompany;
	}

	public void setAppCompany(AppCompany appCompany) {
		this.appCompany = appCompany;
	}

	@Column(name = "passwd", nullable = false, length = 500)
	public String getPasswd() {
		return this.passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	@Column(name = "email", length = 500)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "phone", length = 500)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "im", length = 500)
	public String getIm() {
		return this.im;
	}

	public void setIm(String im) {
		this.im = im;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time", nullable = false, length = 29)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "status", nullable = false)
	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Column(name = "token")
	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

}
